# 作者：小七
# 2024年12月31日
class Person:

    def __init__(self, name, weight):
        self.name = name
        self.weight = weight

    def __str__(self):
        return f"我的名字叫{self.name}体重{self.weight}公斤"

    def run(self):
        print(f"{self.name} is running...")
        self.weight -= 0.5
        print(f"{self.name}跑步后体重为 {self.weight}")

    def eat(self):
        print(f"{self.name} is eating...")
        self.weight += 1
        print(f"{self.name}吃东西后体重为 {self.weight}")


if __name__ == '__main__':
    elephant = Person("大象", 80)
    elephant.run()
    elephant.eat()
    print(elephant)
    tiger = Person("老虎", 45)
    tiger.eat()
    tiger.run()
    print(tiger)
